package edu.hunau.cxb19.oop.class17.enums;

/**
 *
 * @author hb
 *
 *         2020-03-18 14:49:29
 */
public enum Operation {
	ADD {
		public double eval(double a, double b) {
			return a + b;
		}
	},
	SUB {
		public double eval(double a, double b) {
			return a - b;
		}
	},
	DIV {
		public double eval(double a, double b) {
			return a / b;
		}
	},
	MULT {
		public double eval(double a, double b) {
			return a * b;
		}
	};

	// 提供一个抽象方法，定义功能
	public abstract double eval(double a, double b);

}
